
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>首页</title>
</head>
<body>
<%
  //获取session中存储的username
  Object username = session.getAttribute("username");
  //如果根本没有这个key，就说明没有登录过，应该展示登录
  if(username==null){
%>
<a href="login.jsp">请登录</a>
        <%}else {%>
<a href="${pageContext.request.contextPath}/addStudent.jsp">添加学生</a>
<a href="${pageContext.request.contextPath}/studentServlet/list">查看学生</a>
<%}%>
</body>
</html>